package com.SuanFa.test;

import java.util.Scanner;

/**
 * 求质数
 */
public class ZhiShu {
    public static void main(String[] args) {
        int temp=0;
        Scanner sc=new Scanner(System.in);
        int L=sc.nextInt();
        int i=2;
        int a=0;
        while (temp<=L){
            if (check(i)){
                temp+=i;
                if (temp>L){
                    break;
                }
                System.out.println(i);
                a++;
            }
            i++;
        }
        System.out.println(a);
    }
    public static boolean check(int i){
        if (i<=3){
            return i>1;
        }
        for (int j = 2; j <= i / 2; j++) {
            if (i%j==0){
                return false;
            }
        }
        return true;
    }
}